<?php
header('content-type:text/html;charset=utf-8');
header('Access-Control-Allow-Origin: *');
require 'public_func.php';
$link=dbInitial();
$userName = "";
$passWord = "";

if(isset($_GET["userName"])) {
    $userName = $_GET["userName"];

}

if(isset($_GET["passWord"])) {
    $passWord = $_GET["passWord"];
}

if ($userName && $passWord) {//如果用户名和密码都不为空
    $sql = "select userName,password from library.user where userName = '" . $userName . "'";
    $emp = fetchAll($link, $sql);
    mysqli_close($link);


// 将数组转成json格式
    $json = json_encode($emp, JSON_UNESCAPED_UNICODE);


    echo $json;
}


?>


